from tkinter import *
x = int(input())
if x > 500:
    print('слишком большая координата X')
    exit()
    
y = int(input())
if y > 500:
    print('слишком большая координата Y')
    exit()
n = int(input())
if n > 5 or n < -4:

        
    print('слишком большой коэффицент')
    exit()
if n == 0 and x>=0 and x<=500 and y>=0 and y<=500:
    pass
else:
    if n > 0 and 0*n+x>=0 and 0*n+y>=0 and 50*n+x<=500 and 50*n+y<=500:
        pass
    else:
        if n < 0 and 50*n+x>=0 and 50*n+y>=0 and 0*n+x<=500 and 0*n+y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title('ИТ марафон')
root.geometry('500x500')
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

def figure(x,y,n):
    canvas.create_polygon([(0*n+x,0*n+y),(50*n+x,0*n+y),(50*n+x,50*n+y),(100*n+x,50*n+y),(100*n+x,150*n+y),(50*n+x,150*n+y),(50*n+x,100*n+y),(0*n+x,100*n+y),(0*n+x,0*n+y)])

figure(x,y,n)

root.mainloop()
